package com.aaa.ssm.controller;

import com.aaa.ssm.entity.Dicgchannel;
import com.aaa.ssm.service.DicgchannelService;
import com.aaa.ssm.util.Page;
import com.aaa.ssm.util.Result;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;



@RestController
@RequestMapping("dicgchannel")
public class DicgchangeController extends BaseController {

    @Resource
    private DicgchannelService dicgchannelService;

    @PostMapping("page")
    //@RequestBody 将字符串或者集合转换为JSON字符串或者对象
    public Result page(@RequestBody Page<Dicgchannel> page1) {
        return success(dicgchannelService.queryAll(page1));
    }
    @PostMapping("add")
    public Result add(@RequestBody Dicgchannel dicgchannel) {
        return success(dicgchannelService.add(dicgchannel));
    }
    @PostMapping("update")
    public Result update(@RequestBody Dicgchannel dicgchannel) {
        return success(dicgchannelService.update(dicgchannel));
    }
@DeleteMapping("delete/{code}")
    public Result delete(@PathVariable("code") String code) {
        return success(dicgchannelService.delete(code));
    }
}

